package com.cn.study0011.Test007;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName MenuMy.java
 * @Description
 * @createTime 2023年05月16日 18:14:00
 */
public class MenuMy {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        MyShopping m=new MyShopping();
        int i=0;
        do {
            m.m1();
            if (sc.hasNextInt()){
                i=sc.nextInt();
                switch (i){
                    case 1:
                        do {
                            m.m2();
                            if (sc.hasNextInt()){
                                i=sc.nextInt();
                                switch (i){
                                    case 0:
                                        break;
                                    case 1:
                                        m.m4();
                                        if (sc.hasNextInt()){
                                            i=sc.nextInt();
                                            switch (i){
                                                case 0:
                                                    continue;
                                                case 1:
                                                    i=-1;
                                                    break;
                                                case 2:
                                                    i=-1;
                                                    break;
                                                case 3:
                                                    i=-1;
                                                    break;
                                                default:
                                                    break;
                                            }
                                        }
                                        break;
                                    case 2:
                                        m.m3();
                                        if (sc.hasNextInt()){
                                            i=sc.nextInt();
                                            switch (i){
                                                case 0:
                                                    continue;
                                                case 1:
                                                    m.m3_1();
                                                    i=-1;
                                                    break;
                                                case 2:
                                                    m.m3_2();
                                                    i=-1;
                                                    break;
                                                case 3:
                                                    m.m3_3();
                                                    i=-1;
                                                    break;
                                                default:
                                                    break;
                                            }
                                        }
                                        break;
                                    default:
                                        break;
                                }
                            }
                            break;
                        }while (i!=-1);
                        continue;
                    case 2:
                        System.out.println("欢迎您的使用。");
                        break;
                    default:
                }
            }else{
                System.out.println("输入字符不合法！");
            }
            break;
        }while (i!=-1);
    }
}
